class Tool {
    constructor() {
        this.type = ~~(Math.random() * 2);
        if (this.type === 0) {
            this.img = imgList[29];
        }
        else if (this.type === 1) {
            
            this.img = imgList[30];
        }
        this.width = this.img.width;
        this.height = this.img.height;
        
        this.x = ~~(Math.random() * game.width);
        this.y = ~~(Math.random() * game.height);
    }

    /**
     * 绘制自己
     * @param {CanvasRenderingContext2D} ctx 
     */
    draw(ctx) {
        ctx.drawImage(this.img, this.x, this.y, this.width, this.height);
    }
}